#{extends '/include/main.html' /}

<div class="search-result-zone">
	<h2 class="search-result-title">核心表管理</h2>
	<div class="search-result-query-zone">
		<a href="@@{CoreTableController.form()}"  class="search-result-button search-result-new">新建</a>
		<form action="@@{CoreTableController.list()}">
			表名: <input type="text" name="name" value="${name}"/>
			人名: <select name="maintainerId"  class="search-result-select">
					<option>请选择</option>
					#{list items : maintainers, as : 'maintainer'}
						<option value="${maintainer.id}" #{if maintainer.id == maintainerId}selected#{/if}>${maintainer.name}</option>
					#{/list}
				</select>
			<input type="submit" value="查询" class="search-result-button"/>
		</form>
	</div>
	<table id="search-result">
		<thead>
			<tr>
				<th>序号</th>
				<th class="search-row-tablename">表名</th>
				<th>维护人员</th>
				<th>描述</th>
				<th>最后修改时间</th>
				<th>修改</th>
			</tr>
		</thead>
		<tbody>
			#{if paged.items.size() < 1}
				#{emptyContent number:6 /}
			#{/if}
			#{else}
				#{list items : paged.items, as : 'table'}
					<tr>
						<td>${table.id}</td>
						<td class="search-row-tablename">${table.name}</td>
						<td>${table.maintainer.name}</td>
						<td>${table.description}</td>
						<td>#{time time : table.updateDate/}</td>
						<td><a href="@@{CoreTableController.form(table.id)}">修改</a></td>
					</tr>
				#{/list}
			#{/else}
		</tbody>
	</table>
	<div class="search-select-page-zone">
	</div>
</div>
<script>
	DwManager.renderTurnPage({
		target : $(".search-select-page-zone"),
		url : "@@{CoreTableController.list}",
		currentPage : "${paged.currentPage}",
		totalPage : "${paged.totalPage}",
		query : {
			name : "${name}",
			maintainerId : "${maintainerId}"
		}
	});
</script>
